package com.qingfeng.core.dao.qingfeng;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.qingfeng.core.config.database.BaseMapper;
import com.qingfeng.core.dao.BaseDao;
import com.qingfeng.core.entity.qingfeng.School;
import com.qingfeng.core.mapper.qingfeng.SchoolMapper;

@Repository
public class SchoolDao extends BaseDao<School>{

	 @Autowired
	 SchoolMapper schoolMapper;
	 
	@Override
	protected BaseMapper<School> getBaseMapper() {
		return schoolMapper;
	}

	public List<School> getSchoolList(int area_id){		
		return schoolMapper.select(new School(area_id));
	}
	
	public boolean save(School school){
		int record=schoolMapper.insertSelective(school);
		System.out.println("record:"+record);
		return record>0;
	}
}
